API: gdk: Remove title from gdk_window_new()
authorBenjamin Otte <otte@redhat.com>
Fri, 4 Nov 2016 03:08:50 +0000 (04:08 +0100)
committerBenjamin Otte <otte@redhat.com>
Sat, 5 Nov 2016 02:32:27 +0000 (03:32 +0100)
Use gdk_window_set_title() afterwards instead.

gdk/gdkwindow.h
gdk/mir/gdkmirwindowimpl.c
gdk/quartz/gdkwindow-quartz.c
gdk/wayland/gdkwindow-wayland.c
gdk/win32/gdkwindow-win32.c
gdk/x11/gdkwindow-x11.c
gtk/gtkwindow.c

index 3144aa1305bbd5f9d5e92193696cf375650c318f..8a62ba676c9730b0080886b11729a3f6aa9e5205 100644 (file)
@@ -85,24 +85,22 @@ typedef enum
 
 /**
  * GdkWindowAttributesType:
- * @GDK_WA_TITLE: Honor the title field
  * @GDK_WA_X: Honor the X coordinate field
  * @GDK_WA_Y: Honor the Y coordinate field
  * @GDK_WA_TYPE_HINT: Honor the type_hint field
  *
  * Used to indicate which fields in the #GdkWindowAttr struct should be honored.
- * For example, if you filled in the “title” and “x” fields of #GdkWindowAttr,
- * pass “@GDK_WA_X | @GDK_WA_TITLE” to gdk_window_new(). Fields in
+ * For example, if you filled in the “x” and “y” fields of #GdkWindowAttr,
+ * pass “@GDK_WA_X | @GDK_WA_Y” to gdk_window_new(). Fields in
  * #GdkWindowAttr not covered by a bit in this enum are required; for example,
  * the @width/@height, @wclass, and @window_type fields are required, they have
  * no corresponding flag in #GdkWindowAttributesType.
  */
 typedef enum
 {
-  GDK_WA_TITLE    = 1 << 1,
-  GDK_WA_X        = 1 << 2,
-  GDK_WA_Y        = 1 << 3,
-  GDK_WA_TYPE_HINT = 1 << 4
+  GDK_WA_X        = 1 << 1,
+  GDK_WA_Y        = 1 << 2,
+  GDK_WA_TYPE_HINT = 1 << 3
 } GdkWindowAttributesType;
 
 /* Size restriction enumeration.
@@ -321,7 +319,6 @@ typedef enum
 
 /**
  * GdkWindowAttr:
- * @title: title of the window (for toplevel windows)
  * @event_mask: event mask (see gdk_window_set_events())
  * @x: X coordinate relative to parent window (see gdk_window_move())
  * @y: Y coordinate relative to parent window (see gdk_window_move())
@@ -337,7 +334,6 @@ typedef enum
  */
 struct _GdkWindowAttr
 {
-  gchar *title;
   gint event_mask;
   gint x, y;
   gint width;
index 48ae34d3f983d421bcabdb1a81156c37b22d2fde..39f23d9df91df96aa3addd0c6405ad7f591fba44 100644 (file)
@@ -172,10 +172,7 @@ _gdk_mir_window_impl_new (GdkDisplay *display, GdkWindow *window, GdkWindowAttr
 
   impl->display = display;
 
-  if (attributes && attributes_mask & GDK_WA_TITLE)
-    impl->title = g_strdup (attributes->title);
-  else
-    impl->title = g_strdup (get_default_title ());
+  impl->title = g_strdup (get_default_title ());
 
   if (attributes && attributes_mask & GDK_WA_TYPE_HINT)
     impl->type_hint = attributes->type_hint;
index c5f536742ede5b8f5f6e04894edc9a1d6264dc38..3a86081ba87aa5e6c535496c9221ad7a56d0a4a8 100644 (file)
@@ -817,7 +817,6 @@ _gdk_quartz_display_create_window_impl (GdkDisplay    *display,
         NSRect content_rect;
         NSUInteger style_mask;
         int nx, ny;
-        const char *title;
 
         /* initWithContentRect will place on the mainScreen by default.
          * We want to select the screen to place on ourselves.  We need
@@ -855,12 +854,7 @@ _gdk_quartz_display_create_window_impl (GdkDisplay    *display,
                                                                  defer:NO
                                                                   screen:screen];
 
-       if (attributes_mask & GDK_WA_TITLE)
-         title = attributes->title;
-       else
-         title = get_default_title ();
-
-       gdk_window_set_title (window, title);
+       gdk_window_set_title (window, get_default_title ());
   
         [impl->toplevel setOpaque:NO];
         [impl->toplevel setBackgroundColor:[NSColor clearColor]];
index 08af04c9b8dafd4977dae75f844569ae6e194c95..0b4ee602a909c8fd59850c1ada12553d3dc81366 100644 (file)
@@ -663,7 +663,6 @@ _gdk_wayland_display_create_window_impl (GdkDisplay    *display,
   GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (display);
   GdkWindowImplWayland *impl;
   GdkFrameClock *frame_clock;
-  const char *title;
 
   impl = g_object_new (GDK_TYPE_WINDOW_IMPL_WAYLAND, NULL);
   window->impl = GDK_WINDOW_IMPL (impl);
@@ -693,12 +692,7 @@ _gdk_wayland_display_create_window_impl (GdkDisplay    *display,
     {
     case GDK_WINDOW_TOPLEVEL:
     case GDK_WINDOW_TEMP:
-      if (attributes_mask & GDK_WA_TITLE)
-        title = attributes->title;
-      else
-        title = get_default_title ();
-
-      gdk_window_set_title (window, title);
+      gdk_window_set_title (window, get_default_title ());
       break;
 
     case GDK_WINDOW_CHILD:
index d21ce028c1f679d34eb7472caa0808a8ff1a9cc7..8462d5e90f6e5fb16865a74d17ccb251a274cb8c 100644 (file)
@@ -732,9 +732,9 @@ _gdk_win32_display_create_window_impl (GdkDisplay    *display,
       remaining_mask &= ~GDK_WA_Y;
     }
 
-  if ((remaining_mask & ~(GDK_WA_TITLE|GDK_WA_TYPE_HINT)) != 0)
+  if ((remaining_mask & ~(GDK_WA_TYPE_HINT)) != 0)
     g_warning ("_gdk_window_impl_new: uexpected attribute 0x%X",
-               remaining_mask & ~(GDK_WA_TITLE|GDK_WA_TYPE_HINT));
+               remaining_mask & ~(GDK_WA_TYPE_HINT));
 
   hparent = GDK_WINDOW_HWND (real_parent);
 
@@ -845,10 +845,7 @@ _gdk_win32_display_create_window_impl (GdkDisplay    *display,
       y = (window->y + window->parent->abs_y - offset_y) * impl->window_scale;
     }
 
-  if (attributes_mask & GDK_WA_TITLE)
-    title = attributes->title;
-  else
-    title = get_default_title ();
+  title = get_default_title ();
   if (!title || !*title)
     title = "";
 
index 1f56bc9fb361ea93a0a52c1984188683b8bbdb7d..279c233f870f6d4c0ad3f8bcceb8ac6d36cfd501 100644 (file)
@@ -915,7 +915,6 @@ _gdk_x11_display_create_window_impl (GdkDisplay    *display,
   XClassHint *class_hint;
 
   unsigned int class;
-  const char *title;
   int depth;
 
   display_x11 = GDK_X11_DISPLAY (display);
@@ -1009,12 +1008,7 @@ _gdk_x11_display_create_window_impl (GdkDisplay    *display,
     {
     case GDK_WINDOW_TOPLEVEL:
     case GDK_WINDOW_TEMP:
-      if (attributes_mask & GDK_WA_TITLE)
-        title = attributes->title;
-      else
-        title = get_default_title ();
-
-      gdk_window_set_title (window, title);
+      gdk_window_set_title (window, get_default_title ());
 
       class_hint = XAllocClassHint ();
       class_hint->res_name = (char *) g_get_prgname ();
index 46030d1a12ef377c94b6354f6ce6bbcbb325415a..6242c0d5f399b846a8047ccd9ed1580549a7dff1 100644 (file)
@@ -6963,7 +6963,6 @@ gtk_window_realize (GtkWidget *widget)
         attributes.window_type = GDK_WINDOW_SUBSURFACE;
 #endif
 
-      attributes.title = priv->title;
       attributes.wclass = GDK_INPUT_OUTPUT;
 
       attributes_mask = 0;
@@ -6990,7 +6989,6 @@ gtk_window_realize (GtkWidget *widget)
       attributes.type_hint = priv->type_hint;
 
       attributes_mask |= GDK_WA_TYPE_HINT;
-      attributes_mask |= (priv->title ? GDK_WA_TITLE : 0);
 
       gdk_window = gdk_window_new (parent_window, &attributes, attributes_mask);
     }
@@ -7029,6 +7027,9 @@ gtk_window_realize (GtkWidget *widget)
     gdk_window_set_transient_for (gdk_window,
                                   _gtk_widget_get_window (GTK_WIDGET (priv->transient_parent)));
 
+  if (priv->title)
+    gdk_window_set_title (gdk_window, priv->title);
+
   if (priv->wm_role)
     gdk_window_set_role (gdk_window, priv->wm_role);